package main

import (
	"fmt"
	"strconv"
	"time"

	"github.com/patrickmn/go-cache"
)

func main() {
	// 创建一个新的缓存对象，过期时间为5分钟
	c := cache.New(1*time.Second, 10*time.Minute)

	// 设置key为"foo"，value为"bar"的缓存项
	c.SetDefault("foo", "bar")

	// 获取key为"foo"的缓存项
	value, found := c.Get("foo")
	if found {
		fmt.Println(value)
	}

	// 等待1秒钟，模拟缓存失效
	time.Sleep(2 * time.Second)

	// 再次获取key为"foo"的缓存项，应该获取不到
	value, found = c.Get("foo")
	if !found {
		fmt.Println("cache expired")
	}
	var a int64
	a = 2324343545454
	s := strconv.FormatInt(a, 10)
	fmt.Println(s)

}
